package com.lagou.edu.service;

import com.lagou.edu.client.EmailApiService;
import com.lagou.edu.component.EmailComponent;
import lombok.RequiredArgsConstructor;
import lombok.SneakyThrows;
import org.apache.dubbo.config.annotation.Service;
import org.springframework.beans.factory.annotation.Value;

import javax.mail.Message;
import javax.mail.Session;
import javax.mail.Transport;
import javax.mail.internet.InternetAddress;
import javax.mail.internet.MimeMessage;
import java.util.Properties;

/**
 * @Author: yeqingyun
 * @Date: 2020/11/20 17:35
 */
@Service
@RequiredArgsConstructor
public class EmailApiServiceImpl implements EmailApiService {

    private final EmailComponent emailComponent;

    @Override
    @SneakyThrows
    public boolean sendEmail(String receiverEmail, String message) {
        emailComponent.sendEmail(receiverEmail, message);
        return true;
    }
}
